package atm;

import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

/**
 * 取款界面
 */
public class GetPanel extends JPanel implements ActionListener {
    private ATM05 atm05;
    private JLabel getLabel = new JLabel("请输入取款金额:");
    private JTextField getTextField = new JTextField();
    private JButton sureBtn = new JButton(new ImageIcon("images/buttonSure.jpg"));
    private JButton clearBtn = new JButton(new ImageIcon("images/buttonClear.jpg"));
    private Font font = new Font("宋体",Font.BOLD,25);
    public GetPanel(ATM05 atm05){
        this.atm05 = atm05;
        this.setLayout(null);
        this.setOpaque(false);

        getLabel.setBounds(300,200,200,50);
        getLabel.setFont(font);
        getTextField.setBounds(300,260,300,50);
        getTextField.setFont(font);
        sureBtn.setBounds(320,340,100,50);
        clearBtn.setBounds(450,340,100,50);
        sureBtn.addActionListener(this);

        this.add(getLabel);
        this.add(getTextField);
        this.add(sureBtn);
        this.add(clearBtn);

    }

    @Override
    public void actionPerformed(ActionEvent e) {
        atm05.showPanel("menu");
    }
}
